package top.superflow.flow.config.template

import top.superflow.lang.StringUtils

object TemplateUtils {


  def getTemplateGroup(groupAndKey : String, defaultGroup : String, splitter : String):String = {
    if(StringUtils.contains(groupAndKey, splitter)){
      return StringUtils.split(groupAndKey, splitter).apply(0)
    }

    return defaultGroup
  }

  def getTemplateId(groupAndKey : String, splitter : String):String = {
    if(StringUtils.contains(groupAndKey, splitter)){
      return StringUtils.split(groupAndKey, splitter).apply(1)
    }

    return groupAndKey
  }
}
